<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>神舟商城官网-提供神舟笔记本、台式机、平板电脑、电脑外设等产品的购买服务</title>
    <script src="../shnzhou/js/jquery-1.11.3.min.js"></script>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->

    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="../shnzhou/css/index.css">
    <style>
        .opa1 {
            opacity: 1;
        }

        .opa2 {
            opacity: 0;
        }
    </style>
</head>

<body>
    <header>
        <div class="header_top">
            <p class="follow_us">
                <span>关注我们</span>
                <a href="#" class="icon_weibo"></a>
                <a href="#" class="icon_baidu"></a>
                <a href="#" class="icon_weixin"></a>
            </p>
            <p class="head_link">
                <a href="html/resign.html" id="login">登录</a>|
                <a href="html/login.html" id="register">注册</a>|
                <a href="">销售网点</a>|
                <a href="">服务网点</a>
            </p>
        </div>

        <div class="head_center">
            <a href="#" class="logo"></a>
            <div class="head_center_sou">
                <p class="search">
                    <input type="text" placeholder="搜索你想要的产品" class="txtSearch">
                    <input type="button" value="" id="btnSearch"><br />
                    <a href="#">RTX2060</a>&nbsp;|&nbsp;
                    <a href="#">i5-9400</a>&nbsp;|&nbsp;
                    <a href="#">1660Ti</a>&nbsp;|&nbsp;
                    <a href="#">i7-9750H</a>
                </p>
                <p class="shopcart">

                    <a href="html/cart.html">购物车<span id="percount">0</span></a>
                </p>
            </div>
        </div>

        <div class="head_nav">
            <ul class="nav">
                <li class="first_li"><a href="">全部商品分类<i></i></a>
                    <div class="all" style="display: none;">
                        <ul>
                            <li><a href="javascript:;">笔记本</a>
                                <div class="fenlei">
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/7/20150715071520180.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>至强王者1</h2>
                                            <h3>超级战神</h3>
                                            <p>战神GX9-CT5DK</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819062423474.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>强悍性能</h2>
                                            <h3>战神系列</h3>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2017/8/20170825030433672.jpg"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>精盾系列产品</h2>
                                            <h3>精盾系列</h3>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819060831115.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>卓越体验</h2>
                                            <h3>飞天系列</h3>
                                        </dd>
                                    </dl>
                                </div>
                            </li>
                            <li><a href="javascript:;">优雅本</a>
                                <div class="fenlei">
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/7/20150715071520180.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>至强王者2</h2>
                                            <h3>超级战神</h3>
                                            <p>战神GX9-CT5DK</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819062423474.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>强悍性能</h2>
                                            <h3>战神系列</h3>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2017/8/20170825030433672.jpg"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>精盾系列产品</h2>
                                            <h3>精盾系列</h3>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819060831115.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>卓越体验</h2>
                                            <h3>飞天系列</h3>
                                        </dd>
                                    </dl>
                                </div>
                            </li>
                            <li><a href="javascript:;">台式机</a>
                                <div class="fenlei">
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/7/20150715071520180.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>至强王者3</h2>
                                            <h3>超级战神</h3>
                                            <p>战神GX9-CT5DK</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819062423474.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>强悍性能</h2>
                                            <h3>战神系列</h3>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2017/8/20170825030433672.jpg"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>精盾系列产品</h2>
                                            <h3>精盾系列</h3>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819060831115.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>卓越体验</h2>
                                            <h3>飞天系列</h3>
                                        </dd>
                                    </dl>
                                </div>
                            </li>
                            <li><a href="javascript:;">商用电脑</a>
                                <div class="fenlei">
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/7/20150715071520180.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>至强王者4</h2>
                                            <h3>超级战神</h3>
                                            <p>战神GX9-CT5DK</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819062423474.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>强悍性能</h2>
                                            <h3>战神系列</h3>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2017/8/20170825030433672.jpg"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>精盾系列产品</h2>
                                            <h3>精盾系列</h3>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819060831115.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>卓越体验</h2>
                                            <h3>飞天系列</h3>
                                        </dd>
                                    </dl>
                                </div>
                            </li>
                            <li><a href="javascript:;">周边</a>
                                <div class="fenlei">
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/7/20150715071520180.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>至强王者5</h2>
                                            <h3>超级战神</h3>
                                            <p>战神GX9-CT5DK</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819062423474.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>强悍性能</h2>
                                            <h3>战神系列</h3>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                            <p>战神Z7M-CT5GA</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2017/8/20170825030433672.jpg"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>精盾系列产品</h2>
                                            <h3>精盾系列</h3>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                            <p>KING BOOK-U45S2</p>
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt><a href=""><img
                                                    src="http://www.hasee.net/uploadfiles/images/2015/8/20150819060831115.png"
                                                    alt=""></a></dt>
                                        <dd>
                                            <h2>卓越体验</h2>
                                            <h3>飞天系列</h3>
                                        </dd>
                                    </dl>
                                </div>
                            </li>
                        </ul>
                    </div>
                </li>
                <li><a href="">首页</a></li>
                <li><a href="">新品推荐</a></li>
                <li><a href="">PCPad</a></li>
                <li><a href="">今日秒杀</a></li>
                <li><a href="">服务支持</a></li>
            </ul>
        </div>
    </header>


    <div class="banner">
        <ul class="nav_image">
            <li><img src="http://www.hasee.net/uploadfiles/images/2019/8/2019082011252479.jpg" alt=""></li>
            <li><img src="http://www.hasee.net/uploadfiles/images/2019/10/20191031115226880.jpg" alt=""></li>
            <li><img src="http://www.hasee.net/uploadfiles/images/2019/4/20190408033314743.jpg" alt=""></li>
            <li><img src="http://www.hasee.net/uploadfiles/images/2019/1/20190102055830050.jpg" alt=""></li>
            <li><img src="http://www.hasee.net/uploadfiles/images/2019/12/20191214093845469.jpg" alt=""></li>
        </ul>
        <ul class="banner_dot">
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
        </ul>
    </div>

    <!-- main -->
    <div class="main">
        <div class="zhuanqu">
            <ul>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2016/1/20160108104035201.jpg" alt=""></a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2016/1/20160108114259192.jpg" alt=""></a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2016/1/20160108104251415.jpg" alt=""></a></li>
            </ul>
        </div>

        <div class="start">
            <h2>明星单品</h2>
            <ul class="start_top">
                <!-- <li><img src="" alt=""></li>
                <li><img src="" alt=""></li> -->
            </ul>
            <ul class="start_bottom">
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2019/7/20190723114856016.jpg" alt="">
                        <div class="start_bottom_news">
                            <h3>战神K670C-G4E1</h3>
                            <p>英特尔奔腾G5420 MX250 2G独显15.6英寸</p>
                            <span>￥3199.00</span>
                        </div>
                    </a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2019/12/2019120311298657.jpg" alt="">
                        <div class="start_bottom_news">
                            <h3>战神K670C-G4E1</h3>
                            <p>英特尔奔腾G5420 MX250 2G独显15.6英寸</p>
                            <span>￥3199.00</span>
                        </div>
                    </a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2019/7/20190723115216055.jpg" alt="">
                        <div class="start_bottom_news">
                            <h3>战神K670C-G4E1</h3>
                            <p>英特尔奔腾G5420 MX250 2G独显15.6英寸</p>
                            <span>￥3199.00</span>
                        </div>
                    </a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2019/8/20190816021019279.jpg" alt="">
                        <div class="start_bottom_news">
                            <h3>战神K670C-G4E1</h3>
                            <p>英特尔奔腾G5420 MX250 2G独显15.6英寸</p>
                            <span>￥3199.00</span>
                        </div>
                    </a></li>
            </ul>
        </div>

        <div class="notebook">
            <h2>笔记本<span>更多》</span></h2>
            <ul class="notebook_l">
                <li class="notebook_first" style="position: relative;"><a href="javascript:;">
                        <div class="notebook_news1"
                            style="position: absolute; right: 16px;bottom: 44px; width: 260px;height: 166px;">
                            <h3>战神Z7M-CT5NA</h3>
                            <p>I5-9300H/512GSSD/GTX1650</p>
                            <span>￥5399.00</span>
                        </div><img src="http://www.hasee.net/uploadfiles/images/2019/4/20190424045928798.jpg" alt="">
                    </a></li>
                <li><a href="javascript:;">
                        <div class="notebook_news">
                            <h3>战神Z7M-CT5NA</h3>
                            <p>I5-9300H/512GSSD/GTX1650</p>
                            <span>￥5399.00</span>
                        </div><img src="http://www.hasee.net/uploadfiles/images/2019/4/20190419031039553.jpg" alt="">
                    </a></li>
                <li><a href="javascript:;">
                        <div class="notebook_news">
                            <h3>战神Z7M-CT5NA</h3>
                            <p>I5-9300H/512GSSD/GTX1650</p>
                            <span>￥5399.00</span>
                        </div><img src="http://www.hasee.net/uploadfiles/images/2019/8/20190801022421878.jpg" alt="">
                    </a></li>
                <li><a href="javascript:;">
                        <div class="notebook_news">
                            <h3>战神Z7M-CT5NA</h3>
                            <p>I5-9300H/512GSSD/GTX1650</p>
                            <span>￥5399.00</span>
                        </div><img src="http://www.hasee.net/uploadfiles/images/2019/4/2019042404578257.jpg" alt="">
                    </a></li>
                <li><a href="javascript:;">
                        <div class="notebook_news">
                            <h3>战神Z7M-CT5NA</h3>
                            <p>I5-9300H/512GSSD/GTX1650</p>
                            <span>￥5399.00</span>
                        </div><img src="http://www.hasee.net/uploadfiles/images/2019/8/20190816021835256.jpg" alt="">
                    </a></li>
            </ul>
            <ul class="notebook_r">
                <h2>HOT热销商品排行</h2>
                <li><a href="javascript:;"><span>1</span><img
                            src="http://www.hasee.net/uploadfiles/images/2019/4/2019042403102185.jpg" alt="">
                        <h3>战神Z7-CT7NA</h3>
                        <h4>6899.00元</h4>
                        <p>月销量<i>74</i></p>
                    </a></li>
                <li><a href="javascript:;"><span>1</span><img
                            src="http://www.hasee.net/uploadfiles/images/2019/4/2019042402289707.jpg" alt="">
                        <h3>战神Z7-CT7NA</h3>
                        <h4>6899.00元</h4>
                        <p>月销量<i>74</i></p>
                    </a></li>
                <li><a href="javascript:;"><span>1</span><img
                            src="http://www.hasee.net/uploadfiles/images/2018/12/20181206023837245.jpg" alt="">
                        <h3>战神Z7-CT7NA</h3>
                        <h4>6899.00元</h4>
                        <p>月销量<i>74</i></p>
                    </a></li>
                <li><a href="javascript:;"><span>1</span><img
                            src="http://www.hasee.net/uploadfiles/images/2018/4/20180424045132988.jpg" alt="">
                        <h3>战神Z7-CT7NA</h3>
                        <h4>6899.00元</h4>
                        <p>月销量<i>74</i></p>
                    </a></li>
                <li><a href="javascript:;"><span>1</span><img
                            src="http://www.hasee.net/uploadfiles/images/2019/4/20190424022343274.jpg" alt="">
                        <h3>战神Z7-CT7NA</h3>
                        <h4>6899.00元</h4>
                        <p>月销量<i>74</i></p>
                    </a></li>
            </ul>
        </div>

        <div class="taishiji">
            <h2>台式机<span>更多》</span></h2>
        </div>

        <div class="around" style="margin-bottom: 40px;">
            <h2>周边<span>更多》</span></h2>
            <ul>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2016/8/2016082402282496.png" alt="">
                        <div>
                            <h3>新款神舟双肩背包</h3>
                            <p>舒适透气 休闲学生电脑背包</p><span>￥199.00</span>
                        </div>
                    </a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2019/8/20190802100842047.jpg" alt="">
                        <div>
                            <h3>新款神舟双肩背包</h3>
                            <p>舒适透气 休闲学生电脑背包</p><span>￥199.00</span>
                        </div>
                    </a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2018/5/2018052103494826.jpg" alt="">
                        <div>
                            <h3>新款神舟双肩背包</h3>
                            <p>舒适透气 休闲学生电脑背包</p><span>￥199.00</span>
                        </div>
                    </a></li>
                <li><a href="javascript:;"><img
                            src="http://www.hasee.net/uploadfiles/images/2016/9/20160901101119085.jpg" alt="">
                        <div>
                            <h3>新款神舟双肩背包</h3>
                            <p>舒适透气 休闲学生电脑背包</p><span>￥199.00</span>
                        </div>
                    </a></li>
            </ul>
        </div>
    </div>

    <footer>
        <div class="footer1">
            <div class="foot_top">
                <ul>
                    <li><a href="javascript:;"><img src="http://www.hasee.net/images/icon_1.png" alt=""></a>
                        <p>官方品质保障</p>
                    </li>
                    <li><a href="javascript:;"><img src="http://www.hasee.net/images/icon_2.png" alt=""></a>
                        <p>售后维修保障</p>
                    </li>
                    <li><a href="javascript:;"><img src="http://www.hasee.net/images/icon_3.png" alt=""></a>
                        <p>新品抢先体验</p>
                    </li>
                    <li><a href="javascript:;"><img src="http://www.hasee.net/images/icon_4.png" alt=""></a>
                        <p>个性化定制服务</p>
                    </li>
                    <li><a href="javascript:;"><img src="http://www.hasee.net/images/icon_5.png" alt=""></a>
                        <p>7天退货 15天换货</p>
                    </li>
                </ul>
            </div>
            <div class="foot_center">
                <ul>
                    <li>
                        <h2>帮助中心</h2>
                        <ul>
                            <li>购物指南</li>
                            <li>支付方式</li>
                            <li>配送方式</li>
                        </ul>
                    </li>
                    <li>
                        <h2>服务与支持</h2>
                        <ul>
                            <li>售后政策</li>
                            <li>服务网点</li>
                            <li>驱动下载</li>
                        </ul>
                    </li>
                    <li>
                        <h2>神船分舵</h2>
                        <ul>
                            <li>神舟电脑京东官方旗舰店</li>
                            <li>神舟电脑天猫旗舰店</li>
                            <li>神舟新舟专卖店</li>
                        </ul>
                    </li>
                    <li>
                        <h2>关于我们</h2>
                        <ul>
                            <li>公司简介</li>
                            <li>联系我们</li>
                            <li>加入我们</li>
                        </ul>
                    </li>
                    <li>
                        <h2>关注我们</h2>
                        <ul>
                            <li>新浪微博</li>
                            <li>官方微信</li>
                            <li>神舟笔记本吧</li>
                        </ul>
                    </li>
                    <li class="number">
                        <p>商用电脑热线:<span>400-058-9702</span></p>
                        <p>全国客服热线:<span>400-106-9999</span></p>
                        <p>上午9:00-12:30 &nbsp;下午14:00-18:00（节假日除外）</p>
                    </li>
                </ul>
            </div>

            <div class="foot_bottom">
                All rights reserved © 2015 Hasee<a href="javascript:;">粤ICP备11003995号</a>
                <p><a href="#">网站导航</a>|<a href="#">隐私安全</a>|<a href="#">版权所有</a>|<a href="#">常见问题</a></p>
            </div>
        </div>
        <div class="top" style="width: 50px;height: 50px; position: fixed; right: 0; bottom: 0; background: #ccc;">
            回到顶部
        </div>
    </footer>


    <script>
        //导航栏
        $('.first_li').hover(function name(params) {
            $('.first_li i').css({ background: 'url(http://www.hasee.net/images/bg1_t.png)' })

            // 二级导航栏
            $('.all').css({ display: 'block' })
            $('.all ul li').mouseenter(function name(params) {
                // console.log($(this));
                $(this).css('background', 'white').children().css('color', '#f33c11')
                // 商品分类显示

                $(this).find('.fenlei').css({ display: 'block' })

            })
            $('.all ul li').mouseleave(function name(params) {
                console.log($(this));
                $(this).css('background', '#f33c11').children().css('color', 'white')
                // 商品分类消失
                $(this).find('.fenlei').css({ display: 'none' })


            })


        }, function name(params) {
            $('.all').css({ display: 'none' })
            $('.first_li i').css({ background: 'url(image/xiajian.png)' })
        })


        //轮播图
        let ban = $('.nav_image li')
        // $.each(ban,function name(params) {
        let num = 0

        //小圆按钮
        $('.banner_dot li').click(function name(i, v) {
            console.log($(this).index());
            $(this).css({ background: 'red' })
            $(this).siblings().css({ background: '#000', color: '#fff' })
            $('.nav_image li').eq($(this).index()).fadeIn(1000).siblings().fadeOut(1000)
            num = $(this).index()
        })

        timer = setInterval(() => {
            $('.nav_image li').eq(num).fadeIn(1000).siblings().fadeOut(1000)

            if (num == 4) {
                num = 0
            } else {
                num++
            }
        }, 4000)
        $('.nav_image li').hover(function name(params) {
            clearInterval(timer)
        }, function name(params) {
            timer = setInterval(() => {
                $('.nav_image li').eq(num).fadeIn(1000).siblings().fadeOut(1000)
                $('.banner_dot li').eq(num).css({ background: 'red' }).siblings().css({ background: '#000' })
                if (num == 4) {
                    num = 0
                } else {
                    num++
                }
            }, 4000)
        })



        let id = localStorage.getItem('id')
        let token = localStorage.getItem('token')
        let username = localStorage.getItem('username')


        if (token) {
            $('#login').html(username)
            $('#register').html('退出')

            $('#register').click(function name(params) {
                localStorage.removeItem('token')
                localStorage.removeItem('id')
                localStorage.removeItem('username')

                location.href = '../html/resign.html'
            })

            //检测购物车中商品数量
            $.ajax({
                url: 'http://jx.xuzhixiang.top/ap/api/cart-list.php',
                type: 'get',
                data: { id }
            }).then(res => {
                console.log(res.data);
                let count = 0
                $.each(res.data, function name(i, v) {
                    count += parseInt(res.data[i].pnum)
                })
                $('#percount').html(count)
            })





            $.ajax({
                url: 'http://jx.xuzhixiang.top/ap/api/productlist.php',
                type: 'get',
                data: { uid: id }
            }).then(res => {
                console.log(res);
                let html = ''
                for (let i = 0; i < res.data.length; i++) {
                    let pObj = res.data[i]
                    html += `
                    <li>
                    <a href="html/detail.html?pid=${pObj.pid}"><img src="${pObj.pimg}" alt="">
                   <div class="start_top_news">
                        <h3>${pObj.pname}</h3>
                        <p>${pObj.pdesc}</p>
                        <p>商城价：<span>￥${pObj.pprice}</span></p>
                   </div> 
                </a>     
                </li>
                    `
                }
                $('.start_top').html(html)
            })
        }


        $(window).scroll(function () {
            //为了保证兼容性，这里取两个值，哪个有值取哪一个
            //scrollTop就是触发滚轮事件时滚轮的高度
            var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
            // console.log("滚动距离" + scrollTop);
            if (scrollTop == 0) {
                $('.top').css({ display: 'none' })
            } else {
                $('.top').css({ display: 'block' })
                $(".top").click(function () {
             		if ($(window).scrollTop() > 0) {
             			$("html,body").stop().animate({ scrollTop: 0 }, 600);
             		}
             	});

            }
            
        })

    </script>
</body>

</html>